package com.project.class4_8.proxyMarke.service.impl;

import com.project.class4_8.proxyMarke.bean.OutBean;
import com.project.class4_8.proxyMarke.dao.IOutDao;
import com.project.class4_8.proxyMarke.dao.ISaveDao;
import com.project.class4_8.proxyMarke.dao.impl.OutDaoImpl;
import com.project.class4_8.proxyMarke.dao.impl.SaveDaoImpl;
import com.project.class4_8.proxyMarke.service.IOutService;

public class OutServiceImpl implements IOutService {

    IOutDao outDao = new OutDaoImpl();
    ISaveDao saveDao = new SaveDaoImpl();
    @Override
    public void addOut(OutBean outBean) {
        outDao.addOut(outBean);

        saveDao.updateNum(outBean.getProductID(),outBean.getNumber());
    }

    public static void main(String[] args) {
        ServiceProxy proxy =new ServiceProxy(new OutServiceImpl());
        IOutService service = (IOutService) proxy.getProxy();
        service.addOut(new OutBean("001",10));

    }
}
